// 把数据中child替换为children
export function setChilren(obj) {
    if (Array.isArray(obj)) {
        return obj.map(item => setChilren(item));
    } else if (typeof obj === 'object' && obj !== null) {
        Object.keys(obj).forEach(key => {
            if (key === 'child') {
                obj['children'] = setChilren(obj[key]);
                delete obj['child'];
            } else if (key === 'value') {
                obj['label'] = obj[key];
            } else {
                obj[key] = setChilren(obj[key]);
            }
        });
    }
    return obj;
}